<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title>首页</title>
<link rel="stylesheet" href="./lib/layui/css/layui.css">
<link rel="stylesheet" href="./back/css/page.css" />
<link rel="stylesheet" href="./back/css/ext.css" />
<script type="text/javascript" src="./back/js/jquery.min.js"></script>
<script type="text/javascript" src="./lib/layui/layui.js"></script>
<script type="text/javascript" src="./front/js/Personal.js"></script>
<style type="text/css">
.wenzhang {
	text-align: center;
	height: 235px;
	width: 230px;
	margin-left: 10px;
	padding-top: 100px;
}

.userName {
	padding-top: 50px;
	margin-left: 40px;
}
</style>
</head>

<body>
	<div class="left">
		<div class="bigTitle">个人管理系统</div>
		<div class="lines">
			<div class="active">个人信息管理</div>
			<c:if test="${fenlei!=null}">
				<c:forEach items="${fenlei}" var="tion">
					<div data-cid="${tion.cid}" class="page">${tion.cName}</div>
				</c:forEach>
			</c:if>
		</div>
	</div>
	<div class="top">
		<div class="leftTiyle" id="flTitle">个人信息管理</div>
		<div class="thisUser">当前用户：${userz.userCode}</div>
	</div>
	<div class="content" id="gerenxiangqing" style="display: none;">
		<form class="layui-form">
			<input type="hidden" name="uid" value="${userz.uid}">
			<div class="layui-upload">
				<button type="button" class="layui-btn" id="test1">头像</button>
				<div class="layui-upload-list">
					<img class="layui-upload-img" id="demo1" src="${userz.uimges}"
						height="150" width="150"> <input name="uimges" type="hidden"
						value="${userz.uimges}">
					<p id="demoText"></p>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">用户名:</label>
				<div class="layui-input-inline">
					<input type="text" name="userName" lay-verify="title"
						autocomplete="off" placeholder="请输入标题" class="layui-input"
						value="${userz.userName}"> <span class="userNamez"></span>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">登陆名:</label>
				<div class="layui-input-inline">
					<input type="text" name="userCode" lay-verify="title"
						autocomplete="off" placeholder="请输入标题" class="layui-input"
						value="${userz.userCode}"> <span class="userCodez"></span>
				</div>
			</div>
			<input type="hidden" name="password" value="${userz.password}" />
			<div class="layui-form-item">
				<label class="layui-form-label">修改密码</label>
				<div class="layui-input-inline">
					<input type="checkbox" name="close" lay-skin="switch"
						lay-text="ON|OFF" lay-filter="switchTest">
				</div>
			</div>
			<div class="layui-form-item" style="display: none;" id="passwordz">
				<label class="layui-form-label">原始密码</label>
				<div class="layui-input-inline">
					<input type="password" name="passwordz" required
						lay-verify="required" placeholder="请原始输入密码" class="layui-input" value="${userz.password}">
				</div>
			</div>
			<div class="layui-form-item" style="display: none;" id="newpassword">
				<label class="layui-form-label">新密码</label>
				<div class="layui-input-inline">
					<input type="password" name="newpassword" required
						lay-verify="required" placeholder="请新输入密码" class="layui-input" value="${userz.password}">
				</div>
			</div>
			<div class="layui-form-item" style="display: none;" id="querenpassword">
				<label class="layui-form-label">确认密码</label>
				<div class="layui-input-inline">
					<input type="password" name="querenpassword" required
						lay-verify="required" placeholder="请确认输入密码" class="layui-input" value="${userz.password}">
				</div>
			</div>
			<button class="layui-btn layui-btn-radius" lay-submit
				lay-filter="userForm" style="float: right;" id="xiugaiyonghu">修改用户</button>
		</form>
	</div>
	<div class="content" id="gerenxinxi" style="display: block;">
		<div class="tou">
			<img src="${userz.uimges}" width="150px" height="150px" class="imgs">
			<span class="userName"><h3>用户名:${userz.userName}</h3></span>
			<button class="layui-btn layui-btn-primary"
				style="margin-left: 500px; margin-top: 50px;">
				<i class="layui-icon">修改</i>
			</button>
		</div>
		<c:if test="${fenlei!=null}">
			<c:forEach items="${fenlei}" var="tion">
				<div class="wenzhang">
					<span>${tion.cName}</span>
					<c:if test="${tion.cid==1}">
						<c:forEach begin="0" items="${countlist}" var="countContent"
							end="0">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==2}">
						<c:forEach begin="1" items="${countlist}" var="countContent"
							end="1">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==3}">
						<c:forEach begin="2" items="${countlist}" var="countContent"
							end="2">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==4}">
						<c:forEach begin="3" items="${countlist}" var="countContent"
							end="3">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==5}">
						<c:forEach begin="4" items="${countlist}" var="countContent"
							end="4">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
				</div>
			</c:forEach>
		</c:if>
	</div>
	<div class="content" id="qita" style="display: none;">
		<button class="layui-btn" id="layui-btn">添加按钮</button>

		<table id="demo" lay-filter="test"></table>

		<script type="text/html" id="barDemo">
 		 <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
 		 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		</script>
	</div>
	<div class="contents" id="addContents" style="display: none;">
		<form class="layui-form">

			<div class="layui-form-item">
				<label class="layui-form-label">标题:</label>
				<div class="layui-input-block">
					<input type="text" name="tcontentheader" lay-verify="title"
						autocomplete="off" placeholder="请输入标题" class="layui-input"
						required>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">作者:</label>
				<div class="layui-input-block">
					<input type="text" name="author" lay-verify="title"
						autocomplete="off" placeholder="请输入作者" class="layui-input"
						required>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">分类:</label>
				<div class="layui-input-block">
					<select name="classification.cid" lay-filter="aihao"
						id="selectType">
						<c:forEach items="${fenlei}" var="tion">
							<option value="${tion.cid}">${tion.cName}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<input type="hidden" name="user.uid" value="${userz.uid}"> <input
				type="hidden" name="tid">
			<div id="tcontent" style="margin-top: 160px;"></div>
			<textarea id="text1" style="display: none;" name="tcontent"></textarea>
			<button class="layui-btn layui-btn-radius" lay-submit
				lay-filter="loginForm" style="float: right;" id="wenzhang">文章提交</button>
		</form>

		<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript"
			src="./back/wangEditor/wangEditor.min.js"></script>
		<script type="text/javascript" src="./back/js/ext.js"></script>
		<script type="text/javascript">
			var E = window.wangEditor
			var editor = new E('#tcontent')
			// 配置文件上传服务器端地址
			editor.customConfig.uploadImgServer = 'upload'
			editor.customConfig.uploadFileName = 'file'
			var $text1 = $('#text1')
			editor.customConfig.onchange = function(html) {
				// 监控变化，同步更新到 textarea
				$text1.val(html)
			}
			editor.create()
			E.viewSource.init(editor);
		</script>
	</div>
</body>
</html>